<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>

    </style>
</head>
<body>
<h1>
    skafhksdhghsdifghi

    gyugh
</h1>
</body>
<script src="./ajax.js"></script>
<script>
    const xhr=new XMLHttpRequest;
    console.log(xhr);
    xhr.open("GET","http://localhost:3000/api?name=admin&password=123")
    xhr.send();
    xhr.onreadystatechange = function(){
        if(xhr.readyState === 4 && xhr.status === 200){
            const str = xhr.responseText;
            console.log("本次请求成功");
            // console.log(JSON.parse(str));
        }
    }


</script>
</html>